package com.fa4j.product.stock.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fa4j.common.data.model.Base;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 实体-商品库存记录
 *
 * @since 2025-11-22 21:06:24
 */
@Data
@TableName(value = "t_stock_record", autoResultMap = true)
@Schema(description = "商品库存记录")
public class StockRecord extends Base {

    @TableId(type = IdType.AUTO)
    @Schema(description = "主键")
    private Long id;

    @Schema(description = "库存ID")
    private Long stockId;

    @Schema(description = "业务类型")
    private StockBizType bizType;

    @Schema(description = "业务单号")
    private String bizNo;

    @Schema(description = "变化库存数量")
    private BigDecimal changeQuantity;

    @Schema(description = "变化后库存数量")
    private BigDecimal afterQuantity;

    @Schema(description = "变化后锁定库存数量")
    private BigDecimal afterLockQuantity;

    @Schema(description = "变化后总库存数量")
    private BigDecimal afterTotalQuantity;

    @Schema(description = "操作人ID")
    private Long operatorId;

    @Schema(description = "更新版本号")
    private Long version;

    @Schema(description = "库存记录说明")
    private String remark;

}
